package fr.migo.quisonne.android;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class QuiSonneReceiver extends BroadcastReceiver{

	@Override
	public void onReceive(Context context, Intent intent) {
		
		  if(intent.getAction()!=null && intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)){
           
			  	SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
			  
				if(sharedPreferences.getBoolean(QuiSonnePreferences.PREF_START, true))
					context.startService(new Intent(context,QuiSonneService.class));
		  }
	}
}
